package com.open.yujiakj.core.base;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @program: YJ-admin
 * @description: 实体基类
 * @author: honglei
 * @create: 2022-03-10 18:04
 */
@Data
public class BaseQuery {
    private int pageIndex; //页码
    private int pageSize = 10; //每页条数
    private int page;  //页码
    private int limit = 10;  //每页条数

    /*全局模糊搜索字段*/
    private String searchText;
    // 特殊查询条件集合
    private List<QueryCondition> queryConditions;
    //排序集合
    private List<QuerySort> querySorts;

    public void  addCondition(QueryCondition condition){
        if (queryConditions==null){
            queryConditions=new ArrayList<>();
        }
        queryConditions.add(condition);
    }




    public void setPage(int page) {
        this.page = page;
        this.pageIndex = page;
    }
    public void setLimit(int limit) {
        this.limit = limit;
        this.pageSize = limit;
    }
}
